Shared content delivery infrastructure

ABSTRACT

A method of processing requests for resources in a system in which a plurality of content providers provide multiple resources. Content providers offload the serving of some of their resources to a shared content delivery network (CDN) formed by a plurality of servers. The CDN is shared among the content providers. Some of a content provider&#39;s content may be served from an origin server associated with that content provider, while requests for other content from that content provider are served from the shared CDN.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of and claims priority from pendingU.S. patent application Ser. No. 11/441,253, filed May 26, 2006, whichis a continuation of U.S. patent application Ser. No. 11/065,412, filedFeb. 23, 2005, pending, which is a continuation of U.S. patentapplication Ser. No. 09/612,598, filed Jul. 7. 2000, abandoned, which isa division of U.S. patent application Ser. No. 09/021,506, filed Feb.10, 1998, patented as U.S. Pat. No. 6,185,598, the contents of each ofwhich are hereby fully incorporated herein by reference. Thisapplication is a continuation of and claims priority from U.S. patentapplication Ser. No. 11/065,412, filed Feb. 23, 2005, pending, which isa continuation of U.S. patent application Ser. No. 09/612,598, filedJul. 7, 2000, abandoned, which is a division of U.S. patent applicationSer. No. 09/021,506, filed Feb. 10, 1998, patented as U.S. Pat. No.6,185,598.

FIELD OF THE INVENTION

This invention relates to replication of resources in computer networks.

BACKGROUND OF THE INVENTION

The advent of global computer networks, such as the Internet, have ledto entirely new and different ways to obtain information. A user of theInternet can now access information from anywhere in the world, with noregard for the actual location of either the user or the information. Auser can obtain information simply by knowing a network address for theinformation and providing that address to an appropriate applicationprogram such as a network browser.

The rapid growth in popularity of the Internet has imposed a heavytraffic burden on the entire network. Solutions to problems of demand(e.g., better accessibility and faster communication links) onlyincrease the strain on the supply. Internet Web sites (referred to hereas “publishers”) must handle ever-increasing bandwidth needs,accommodate dynamic changes in load, and improve performance for distantbrowsing clients, especially those overseas. The adoption ofcontent-rich applications, such as live audio and video, has furtherexacerbated the problem.

To address basic bandwidth growth needs, a Web publisher typicallysubscribes to additional bandwidth from an Internet service provider(ISP), whether in the form of larger or additional “pipes” or channelsfrom the ISP to the publisher's premises, or in the form of largebandwidth commitments in an ISP's remote hosting server collection.These increments are not always as fine-grained as the publisher needs,and quite often lead times can cause the publisher's Web site capacityto lag behind demand.

To address more serious bandwidth growth problems, publishers maydevelop more complex and costly custom solutions. The solution to themost common need, increasing capacity, is generally based on replicationof hardware resources and site content (known as mirroring), andduplication of bandwidth resources. These solutions, however, aredifficult and expensive to deploy and operate. As a result, only thelargest publishers can afford them, since only those publishers canamortize the costs over many customers (and Web site hits).

A number of solutions have been developed to advance replication andmirroring. In general, these technologies are designed for use by asingle Web site and do not include features that allow their componentsto be shared by many Web sites simultaneously.

Some solution mechanisms offer replication software that helps keepmirrored servers up-to-date. These mechanisms generally operate bymaking a complete copy of a file system. One such system operates bytransparently keeping multiple copies of a file system in synch. Anothersystem provides mechanisms for explicitly and regularly copying filesthat have changed. Database systems are particularly difficult toreplicate, as they are continually changing. Several mechanisms allowfor replication of databases, although there are no standard approachesfor accomplishing it. Several companies offering proxy caches describethem as replication tools. However, proxy caches differ because they areoperated on behalf of clients rather than publishers.

Once a Web site is served by multiple servers, a challenge is to ensurethat the load is appropriately distributed or balanced among thoseservers. Domain name-server-based round-robin address resolution causesdifferent clients to be directed to different mirrors.

Another solution, load balancing, takes into account the load at eachserver (measured in a variety of ways) to select which server shouldhandle a particular request.

Load balancers use a variety of techniques to route the request to theappropriate server. Most of those load-balancing techniques require thateach server be an exact replica of the primary Web site. Load balancersdo not take into account the “network distance” between the client andcandidate mirror servers.

Assuming that client protocols cannot easily change, there are two majorproblems in the deployment of replicated resources. The first is how toselect which copy of the resource to use. That is, when a request for aresource is made to a single server, how should the choice of a replicaof the server (or of that data) be made. We call this problem the“rendezvous problem”. There are a number of ways to get clients torendezvous at distant mirror servers. These technologies, like loadbalancers, must route a request to an appropriate server, but unlikeload balancers, they take network performance and topology into accountin making the determination.

A number of companies offer products which improve network performanceby prioritizing and filtering network traffic.

Proxy caches provide a way for client aggregators to reduce networkresource consumption by storing copies of popular resources close to theend users. A client aggregator is an Internet service provider or otherorganization that brings a large number of clients operating browsers tothe Internet. Client aggregators may use proxy caches to reduce thebandwidth required to serve web content to these browsers. However,traditional proxy caches are operated on behalf of Web clients ratherthan Web publishers.

Proxy caches store the most popular resources from all publishers, whichmeans they must be very large to achieve reasonable cache efficiency.(The efficiency of a cache is defined as the number of requests forresources which are already cached divided by the total number ofrequests.)

Proxy caches depend on cache control hints delivered with resources todetermine when the resources should be replaced. These hints arepredictive, and are necessarily often incorrect, so proxy cachesfrequently serve stale data. In many cases, proxy cache operatorsinstruct their proxy to ignore hints in order to make the cache moreefficient, even though this causes it to more frequently serve staledata.

Proxy caches hide the activity of clients from publishers. Once aresource is cached, the publisher has no way of knowing how often it wasaccessed from the cache.

SUMMARY OF THE INVENTION

This invention provides a way for servers in a computer network tooff-load their processing of requests for selected resources bydetermining a different server (a “repeater”) to process those requests.The selection of the repeater can be made dynamically, based oninformation about possible repeaters.

If a requested resource contains references to other resources, some orall of these references can be replaced by references to repeaters.

Accordingly, in one aspect, this invention is a method of processingresource requests in a computer network. First a client makes a requestfor a particular resource from an origin server, the request including aresource identifier for the particular resource, the resource identifiersometimes including an indication of the origin server. Requestsarriving at the origin server do not always include an indication of theorigin server; since they are sent to the origin server, they do notneed to name it. A mechanism referred to as a reflector, co-located withthe origin server, intercepts the request from the client to the originserver and decides whether to reflect the request or to handle itlocally. If the reflector decides to handle the request locally, itforwards it to the origin server, otherwise it selects a “best” repeaterto process the request. If the request is reflected, the client isprovided with a modified resource identifier designating the repeater.

The client gets the modified resource identifier from the reflector andmakes a request for the particular resource from the repeater designatedin the modified resource identifier.

When the repeater gets the client's request, it responds by returningthe requested resource to the client. If the repeater has a local copyof the resource then it returns that copy, otherwise it forwards therequest to the origin server to get the resource, and saves a local copyof the resource in order to serve subsequent requests.

The selection by the reflector of an appropriate repeater to handle therequest can be done in a number of ways. In the preferred embodiment, itis done by first pre-partitioning the network into “cost groups” andthen determining which cost group the client is in. Next, from aplurality of repeaters in the network, a set of repeaters is selected,the members of the set having a low cost relative to the cost groupwhich the client is in. In order to determine the lowest cost, a tableis maintained and regularly updated to define the cost between eachgroup and each repeater. Then one member of the set is selected,preferably randomly, as the best repeater.

If the particular requested resource itself can contain identifiers ofother resources, then the resource may be rewritten (before beingprovided to the client). In particular, the resource is rewritten toreplace at least some of the resource identifiers contained therein withmodified resource identifiers designating a repeater instead of theorigin server. As a consequence of this rewriting process, when theclient requests other resources based on identifiers in the particularrequested resource, the client will make those requests directly to theselected repeater, bypassing the reflector and origin server entirely.

Resource rewriting must be performed by reflectors. It may also beperformed by repeaters, in the situation where repeaters “peer” with oneanother and make copies of resources which include rewritten resourceidentifiers that designate a repeater.

In a preferred embodiment, the network is the Internet and the resourceidentifier is a uniform resource locator (URL) for designating resourceson the Internet, and the modified resource identifier is a URLdesignating the repeater and indicating the origin server (as describedin step B3 below), and the modified resource identifier is provided tothe client using a REDIRECT message. Note, only when the reflector is“reflecting” a request is the modified resource identifier providedusing a REDIRECT message.

In another aspect, this invention is a computer network comprising aplurality of origin servers, at least some of the origin servers havingreflectors associated therewith, and a plurality of repeaters.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects and advantages of the invention will beapparent upon consideration of the following detailed description, takenin conjunction with the accompanying drawings, in which the referencecharacters refer to like parts throughout and in which:

FIG. 1 depicts a portion of a network environment according to thepresent invention; and

FIGS. 2-6 are flow charts of the operation of the present invention.

DETAILED DESCRIPTION OF THE PRESENTLY PREFERRED EXEMPLARY EMBODIMENTS

Overview

FIG. 1 shows a portion of a network environment 100 according to thepresent invention, wherein a mechanism (reflector 108, described indetail below) at a server (herein origin server 102) maintains and keepstrack of a number of partially replicated servers or repeaters 104 a,104 b, and 104 c. Each repeater 104 a, 104 b, and 104 c replicates someor all of the information available on the origin server 102 as well asinformation available on other origin servers in the network 100.Reflector 108 is connected to a particular repeater known as its“contact” repeater (“Repeater B” 104 b in the system depicted in FIG.1). Preferably each reflector maintains a connection with a singlerepeater known as its contact, and each repeater maintains a connectionwith a special repeater known as its master repeater (e.g., repeater 104m for repeaters 104 a, 104 b and 104 c in FIG. 1).

Thus, a repeater can be considered as a dedicated proxy server thatmaintains a partial or sparse mirror of the origin server 102, byimplementing a distributed coherent cache of the origin server. Arepeater may maintain a (partial) mirror of more than one origin server.In some embodiments, the network 100 is the Internet and repeatersmirror selected resources provided by origin servers in response toclients' HTTP (hypertext transfer protocol) and FTP (file transferprotocol) requests.

A client 106 connects, via the network 100, to origin server 102 andpossibly to one or more repeaters 104 a etc.

Origin server 102 is a server at which resources originate. Moregenerally, the origin server 102 is any process or collection ofprocesses that provide resources in response to requests from a client106. Origin server 102 can be any off-the-shelf Web server. In apreferred embodiment, origin server 102 is typically a Web server suchas the Apache server or Netscape Communications Corporation'sEnterprise™ server.

Client 106 is a processor requesting resources from origin server 102 onbehalf of an end user. The client 106 is typically a user agent (e.g., aWeb browser such as Netscape Communications Corporation's Navigator™) ora proxy for a user agent. Components other than the reflector 108 andthe repeaters 104 a, 104 b, etc., may be implemented using commonlyavailable software programs. In particular, this invention works withany HTTP client (e.g., a Web browser), proxy cache, and Web server. Inaddition, the reflector 108 might be fully integrated into the dataserver 112 (for instance, in a Web Server). These components might beloosely integrated based on the use of extension mechanisms (such asso-called add-in modules) or tightly integrated by modifying the servicecomponent specifically to support the repeaters.

Resources originating at the origin server 102 may be static or dynamic.That is, the resources may be fixed or they may be created by the originserver 102 specifically in response to a request. Note that the terms“static” and “dynamic” are relative, since a static resource may changeat some regular, albeit long, interval.

Resource requests from the client 106 to the origin server 102 areintercepted by reflector 108 which for a given request either forwardsthe request on to the origin server 102 or conditionally reflects it tosome repeater 104 a, 104 b, etc. in the network 100. That is, dependingon the nature of the request by the client 106 to the origin server 102,the reflector 108 either serves the request locally (at the originserver 102), or selects one of the repeaters (preferably the bestrepeater for the job) and reflects the request to the selected repeater.In other words, the reflector 108 causes requests for resources fromorigin server 102, made by client 106, to be either served locally bythe origin server 102 or transparently reflected to the best repeater104 a, 104 b, etc. The notion of a best repeater and the manner in whichthe best repeater is selected are described in detail below.

Repeaters 104 a, 104 b, etc. are intermediate processors used to serviceclient requests thereby improving performance and reducing costs in themanner described herein. Within repeaters 104 a, 104 b, etc., are anyprocesses or collections of processes that deliver resources to theclient 106 on behalf of the origin server 102. A repeater may include arepeater cache 110, used to avoid unnecessary transactions with theorigin server 102.

The reflector 108 is a mechanism, preferably a software program, thatintercepts requests that would normally be sent directly to the originserver 102. While shown in the drawings as separate components, thereflector 108 and the origin server 102 are typically co-located, e.g.,on a particular system such as data server 112. (As discussed below, thereflector 108 may even be a “plug in” module that becomes part of theorigin server 102.

FIG. 1 shows only a part of a network 100 according to this invention. Acomplete operating network consists of any number of clients, repeaters,reflectors, and origin servers. Reflectors communicate with the repeaternetwork, and repeaters in the network communicate with one another.

Uniform Resource Locators

Each location in a computer network has an address which can generallybe specified as a series of names or numbers. In order to accessinformation, an address for that information must be known. For example,on the World Wide Web (“the Web”) which is a subset of the Internet, themanner in which information address locations are provided has beenstandardized into Uniform Resource Locators (URLs). URLs specify thelocation of resources (information, data files, etc.) on the network.

The notion of URLs becomes even more useful when hypertext documents areused. A hypertext document is one which includes, within the documentitself, links (pointers or references) to the document itself or toother documents. For example, in an on-line legal research system, eachcase may be presented as a hypertext document. When other cases arecited, links to those cases can be provided. In this way, when a personis reading a case, they can follow cite links to read the appropriateparts of cited cases.

In the case of the Internet in general and the World Wide Webspecifically, documents can be created using a standardized form knownas the Hypertext Markup Language (HTML). In HTML, a document consists ofdata (text, images, sounds, and the like), including links to othersections of the same document or to other documents. The links aregenerally provided as URLs, and can be in relative or absolute form.Relative URLs simply omit the parts of the URL which are the same as forthe document including the link, such as the address of the document(when linking to the same document), etc. In general, a browser programwill fill in missing parts of a URL using the corresponding parts fromthe current document, thereby forming a fully formed URL including afully qualified domain name, etc.

A hypertext document may contain any number of links to other documents,and each of those other documents may be on a different server in adifferent part of the world. For example, a document may contain linksto documents in Russia, Africa, China and Australia. A user viewing thatdocument at a particular client can follow any of the linkstransparently (i.e., without knowing where the document being linked toactually resides). Accordingly, the cost (in terms of time or money orresource allocation) of following one link versus another may be quitesignificant.

URLs generally have the following form (defined in detail in T.Berners-Lee et al, Uniform Resource Locators (URL), Network WorkingGroup, Request for Comments: 1738, Category: Standards Track, December1994, located at “http://ds.internic.net/rfc/rfc1738.txt”, which ishereby incorporated herein by reference):

scheme://host[:port]/url-path

where “scheme” can be a symbol such as “file” (for a file on the localsystem), “ftp” (for a file on an anonymous FTP file server), “http” (fora file on a file on a Web server),and “telnet” (for a connection to aTelnet-based service). Other schemes, can also be used and new schemesare added every now and then. The port number is optional, the systemsubstituting a default port number (depending on the scheme) if none isprovided. The “host” field maps to a particular network address for aparticular computer. The “url-path” is relative to the computerspecified in the “host” field. A url-path is typically, but notnecessarily, the pathname of a file in a web server directory.

For example, the following is a URL identifying a file “F” in the path“A/B/C” on a computer at “www.uspto.gov”:

http://www.uspto.gov/A/B/C/F

In order to access the file “F” (the resource) specified by the aboveURL, a program (e.g., a browser) running on a user's computer (i.e., aclient computer) would have to first locate the computer (i.e., a servercomputer) specified by the host name. I.e., the program would have tolocate the server “www.uspto.gov”. To do this, it would access a DomainName Server (DNS), providing the DNS with the host name(“www.uspto.gov”). The DNS acts as a kind of centralized directory forresolving addresses from names. If the DNS determines that there is a(remote server) computer corresponding to the name “www.uspto.gov”, itwill provide the program with an actual computer network address forthat server computer. On the Internet this is called an InternetProtocol (or IP) address and it has the form “123.345.456.678”. Theprogram on the user's (client) computer would then use the actualaddress to access the remote (server) computer.

The program opens a connection to the HTTP server (Web server) on theremote computer “www.uspto.gov” and uses the connection to send arequest message to the remote computer (using the HTTP scheme). Themessage is typically an HTTP GET request which includes the url-path ofthe requested resource, “A/B/C/F”. The HTTP server receives the requestand uses it to access the resource specified by the url-path “A/B/C/F”.The server returns the resource over the same connection.

Thus, conventionally HTTP client requests for Web resources at an originserver 102 are processed as follows (see FIG. 2) (This is a descriptionof the process when no reflector 108 is installed.):

-   -   A1. A browser (e.g., Netscape's Navigator) at the client        receives a resource identifier (i.e., a URL) from a user.    -   A2. The browser extracts the host (origin server) name from the        resource identifier, and uses a domain name server (DNS) to look        up the network (IP) address of the corresponding server. The        browser also extracts a port number, if one is present, or uses        a default port number (the default port number for http requests        is 80).    -   A3. The browser uses the server's network address and port        number to establish a connection between the client 106 and the        host or origin server 102.    -   A4. The client 106 then sends a (GET) request over the        connection identifying the requested resource.    -   A5. The origin server 102 receives the request and    -   A6. locates or composes the corresponding resource.    -   A7. The origin server 102 then sends back to the client 106 a        reply containing the requested resource (or some form of error        indicator if the resource is unavailable). The reply is sent to        the client over the same connection as that on which the request        was received from the client.    -   A8. The client 106 receives the reply from the origin server        102.

There are many variations of this basic model. For example, in onevariation, instead of providing the client with the resource, the originserver can tell the client to re-request the resource by another name.To do so, in A7 the server 102 sends back to the client 106 a replycalled a “REDIRECT” which contains a new URL indicating the other name.The client 106 then repeats the entire sequence, normally without anyuser intervention, this time requesting the resource identified by thenew URL.

System Operation

In this invention reflector 108 effectively takes the place of anordinary Web server or origin server 102. The reflector 108 does this bytaking over the origin server's IP address and port number. In this way,when a client tries to connect to the origin server 102, it willactually connect to the reflector 108. The original Web server (ororigin server 102) must then accept requests at a different network (IP)address, or at the same IP address but on a different port number. Thus,using this invention, the server referred to in A3-A7 above is actuallya reflector 108.

Note that it is also possible to leave the origin server's networkaddress as it is and to let the reflector run at a different address oron a different port. In this way the reflector does not interceptrequests sent to the origin server, but can still be sent requestsaddressed specifically to the reflector. Thus the system can be testedand configured without interrupting its normal operation.

The reflector 108 supports the processing as follows (see FIG. 3):

-   -   upon receipt of a request,    -   B1 The reflector 108 analyzes the request to determine whether        or not to reflect the request. To do this, first the reflector        determines whether the sender (client 106) is a browser or a        repeater. Requests issued by repeaters must be served locally by        the origin server 102. This determination can be made by looking        up the network (IP) address of the sender in a list of known        repeater network (IP) addresses. Alternatively, this        determination could be made by attaching information to a        request to indicate that the request is from a specific        repeater, or repeaters can request resources from a special port        other than the one used for ordinary clients.    -   B2 If the request is not from a repeater, the reflector looks up        the requested resource in a table (called the “rule base”) to        determine whether the resource requested is “repeatable”. Based        on this determination, the reflector either reflects the request        (B3, described below) or serves the request locally (B4,        described below).

The rule base is a list of regular expressions and associatedattributes. (Regular expressions are well-known in the field of computerscience. A small bibliography of their use is found in Aho, et al.,“Compilers, Principles, techniques and tools”, Addison-Wesley, 1986, pp.157-158.) The resource identifier (URL) for a given request is looked upin the rule base by matching it sequentially with each regularexpression. The first match identifies the attributes for the resource,namely repeatable or local. If there is no match in the rule base, adefault attribute is used. Each reflector has its own rule base, whichis manually configured by the reflector operator.

-   -   B3. To reflect a request, (to serve a request locally go to B4),        as shown in FIG. 4, the reflector determines (B3-1) the best        repeater to reflect the request to, as described in detail        below. The reflector then creates (B3-2) a new resource        identifier (URL) (using the requested URL and the best repeater)        that identifies the same resource at the selected repeater.    -   It is necessary that the reflection step create a single URL        containing the URL of the original resource, as well as the        identity of the selected repeater. A special form of URL is        created to provide this information. This is done by creating a        new URL as follows:    -   D1. Given a repeater name, scheme, origin server name and path,        create a new URL. If the scheme is “http”, the preferred        embodiment uses the following format:        -   http://<repeater>/<server>/<path>    -   If the form used is other than “http”, the preferred embodiment        uses the following format:        -   http://<repeater>/<server>@proxy=<scheme>@/<path>    -   The reflector can also attach a MIME type to the request, to        cause the repeater to provide that MIME type with the result.        This is useful because many protocols (such as FTP) do not        provide a way to attach a MIME type to a resource. The format is        -   http://<repeater>/<server>@proxy=<scheme>:<type>@/<path>    -   This URL is interpreted when received by the repeater.    -   The reflector then sends (B3-3) a REDIRECT reply containing this        new URL to the requesting client. The HTTP REDIRECT command        allows the reflector to send the browser a single URL to retry        the request.    -   B4. To serve a request locally, the request is sent by the        reflector to (“forwarded to”) the origin server 102. In this        mode, the reflector acts as a reverse proxy server. The origin        server 102 processes the request in the normal manner (A5-A7).        The reflector then obtains the origin server's reply to the        request which it inspects to determine if the requested resource        is an HTML document, i.e., whether the requested resource is one        which itself contains resource identifiers.    -   B5. If the resource is an HTML document then the reflector        rewrites the HTML document by modifying resource identifiers        (URLs) within it, as described below. The resource, possibly as        modified by rewriting, is then returned in a reply to the        requesting client 106.        -   If the requesting client is a repeater, the reflector may            temporarily disable any cache-control modifiers which tie            origin server attached to the reply. These disabled            cache-control modifiers are later re-enabled when the            content is served from the repeater. This mechanism makes it            possible for the origin server to prevent resources from            being cached at normal proxy caches, without affecting the            behavior of the cache at the repeater.    -   B6. Whether the request is reflected or handled locally, details        about the transaction, such as the current time, the address of        the requester, the URL requested, and the type of response        generated, are written by the reflector to a local log file.

By using a rule base (B2), it is possible to selectively reflectresources. There are a number of reasons that certain particularresources cannot be effectively repeated (and therefore should not bereflected), for instance:

-   -   the resource is composed uniquely for each request;    -   the resource relies on a so-called cookie (browsers will not        send cookies to repeaters with different domain names);    -   the resource is actually a program (such as a Java applet) that        will run on the client and that wishes to connect to a service        (Java requires that the service be running on the same machine        that provided the applet).

In addition, the reflector 108 can be configured so that requests fromcertain network addresses (e.g., requests from clients on the same localarea network as the reflector itself) are never reflected. Also, thereflector may choose not to reflect requests because the reflector isexceeding its committed aggregate information rate, as described below.

A request which is reflected is automatically mirrored at the repeaterwhen the repeater receives and processes the request.

The combination of the reflection process described here and the cachingprocess described below effectively creates a system in which repeatableresources are migrated to and mirrored at the selected reflector, whilenon-repeatable resources are not mirrored.

Alternate Approach

Placing the origin server name in the reflected URL is generally a goodstrategy, but it may be considered undesirable for aesthetic or (in thecase, e.g., of cookies) certain technical reasons.

It is possible to avoid the need for placing both the repeater name andthe server name in the URL. Instead, a “family” of names may be createdfor a given origin server, each name identifying one of the repeatersused by that server.

For instance, if www.example.com is the origin server, names for threerepeaters might be created:

wr1.example.com

wr2.example.com

wr3.example.com

The name “wr1.example.com” would be an alias for repeater 1, which nightalso be known by other names such as “wr1.anotherExample.com” and“wr1.example.edu”.

If the repeater can determine by which name it was addressed, it can usethis information (along with a table that associates repeater aliasnames with origin server names) to determine which origin server isbeing addressed. For instance, if repeater 1 is addressed aswr1.example.com, then the origin server is “www.example.com”; if it isaddressed as “wr1.anotherExample.com”, then the origin server is“www.anotherExample.com”.

The repeater can use two mechanisms to determine by which alias it isaddressed:

-   -   1. Each alias can be associated with a different IP address.        Unfortunately, this solution does not scale well, as IP        addresses are currently scarce, and the number of IP addresses        required grows as the product of origin servers and repeaters.    -   2. The repeater can attempt to determine the alias name used by        inspecting the “host:” tag in the HTTP header of the request.        Unfortunately, some old browsers still in use do not attach the        “host:” tag to a request. Reflectors would need to identify such        browsers (the browser identity is a part of each request) and        avoid this form of reflection.

How a Repeater Handles a Request

When a browser receives a REDIRECT response (as produced in B3), itreissues a request for the resource using the new resource identifier(URL) (A1-A5). Because the new identifier refers to a repeater insteadof the origin server, the browser now sends a request for the resourceto the repeater which processes a request as follows, with reference toFIG. 5:

-   -   C1. First the repeater analyzes the request to determine the        network address of the requesting client and the path of the        resource requested. Included in the path is an origin server        name (as described above with reference to B3).    -   C2. The repeater uses an internal table to verify that the        origin server belongs to a known “subscriber”. A subscriber is        an entity (e.g., a company) that publishes resources (e.g.,        files) via one or more origin servers. When the entity        subscribes, it is permitted to utilize the repeater network. The        subscriber tables described below include the information that        is used to link reflectors to subscribers.        -   If the request is not for a resource from a known            subscriber, the request is rejected. To reject a request,            the repeater returns a reply indicating that the requested            resource does not exist.    -   C3. The repeater then determines whether the requested resource        is cached locally. If the requested resource is in the        repeater's cache it is retrieved.

On the other hand, if a valid copy of the requested resource is not inthe repeater's cache, the repeater modifies the incoming URL, creating arequest that it issues directly to the originating reflector whichprocesses it (as in B1-B6). Because this request to the originatingreflector is from a repeater, the reflector always returns the requestedresource rather than reflecting the request. (Recall that reflectorsalways handle requests from repeaters locally.) If the repeater obtainedthe resource from the origin server, the repeater then caches theresource locally.

-   -   -   If a resource is not cached locally, the cache can query its            “peer caches” to see if one of them contains the resource,            before or at the same time as requesting the resource from            the reflector/origin server. If a peer cache responds            positively in a limited period of time (preferably a small            fraction of a second), the resource will be retrieved from            the peer cache.

    -   C4. The repeater then constructs a reply including the requested        resource (which was retrieved from the cache or from the origin        server) and sends that reply to the requesting client.

    -   C5. Details about the transaction, such as the associated        reflector, the current time, the address of the requester, the        URL requested, and the type of response generated, are written        to a local log file at the repeater.

Note that the bottom row of FIG. 2 refers to an origin server, or areflector, or a repeater, depending on what the URL in step Alidentifies.

Selecting the Best Repeater

If the reflector 108 determines that it will reflect the request, itmust then select the best repeater to handle that request (as referredto in step B3-1). This selection is performed by the Best RepeaterSelector (BRS) mechanism described here.

The goal of the BRS is to select, quickly and heuristically, anappropriate repeater for a given client given only the network addressof the client. An appropriate repeater is one which is not too heavilyloaded and which is not too far from the client in terms of some measureof network distance. The mechanism used here relies on specific,compact, pre-computed data to make a fast decision. Other, dynamicsolutions can also be used to select an appropriate repeater.

The BRS relies on three pre-computed tables, namely the Group ReductionTable, the Link Cost Table, and the Load Table. These three tables(described below) are computed off-line and downloaded to each reflectorby its contact in the repeater network.

The Group Reduction Table places every network address into a group,with the goal that addresses in a group share relative costs, so thatthey would have the same best repeater under varying conditions (i.e.,the BRS is invariant over the members of the group).

The Link Cost Table is a two dimensional matrix which specifies thecurrent cost between each repeater and each group. Initially, the linkcost between a repeater and a group is defined as the “normalized linkcost” between the repeater and the group, as defined below. Over time,the table will be updated with measurements which more accuratelyreflect the relative cost of transmitting a file between the repeaterand a member of the group. The format of the Link Cost Table is <GroupID> <Group ID> <link cost>, where the Group ID's are given as ASnumbers.

The Load Table is a one dimensional table which identifies the currentload at each repeater. Because repeaters may have different capacities,the load is a value that represents the ability of a given repeater toaccept additional work. Each repeater sends its current load to acentral master repeater at regular intervals, preferably at leastapproximately once a minute. The master repeater broadcasts the LoadTable to each reflector in the network, via the contact repeater.

A reflector is provided entries in the Load Table only for repeaterswhich it is assigned to use. The assignment of repeaters to reflectorsis performed centrally by a repeater network operator at the masterrepeater. This assignment makes it possible to modify the service levelof a given reflector. For instance, a very active reflector may use manyrepeaters, whereas a relatively inactive reflector may use fewrepeaters.

Tables may also be configured to provide selective repeater service tosubscribers in other ways, e.g., for their clients in specificgeographic regions, such as Europe or Asia.

Measuring Load

In the presently preferred embodiments, repeater load is measured in twodimensions, namely

1. requests received by the repeater per time interval (RRPT), and

2. bytes sent by the repeater per time interval (BSPT).

For each of these dimensions, a maximum capacity setting is set. Themaximum capacity indicates the point at which the repeater is consideredto be fully loaded. A higher RRPT capacity generally indicates a fasterprocessor, whereas a higher BSPT capacity generally indicates a widernetwork pipe. This form of load measurement assumes that a given serveris dedicated to the task of repeating.

Each repeater regularly calculates its currant RRPT and BSPT, byaccumulating the number of requests received and bytes sent over a shorttime interval. These measurements are used to determine the repeater'sload in each of these dimensions. If a repeater's load exceeds itsconfigured capacity, an alarm message is sent to the repeater networkadministrator.

The two current load components are combined into a single valueindicating overall current load. Similarly, the two maximum capacitycomponents are combined into a single value indicating overall maximumcapacity. The components are combined as follows:current-load=B×current RRPT+(1−B)×current BSPTmax-load=B×max RRPT+(1−B)×max BSPT

The factor B, a value between 0 and 1, allows the relative weights ofRRPT and BSPT to be adjusted, which favors consideration of eitherprocessing power or bandwidth.

The overall current load and overall maximum capacity values areperiodically sent from each repeater to the master repeater, where theyare aggregated in the Load Table, a table summarizing the overall loadfor all repeaters. Changes in the Load Table are distributedautomatically to each reflector.

While the preferred embodiment uses a two-dimensional measure ofrepeater load, any other measure of load can be used.

Combining Link Costs and Load

The BRS computes the cost of servicing a given client from each eligiblerepeater. The cost is computed by combining the available capacity ofthe candidate repeater with the cost of the link between that repeaterand the client. The link cost is computed by simply looking it up in theLink Cost table.

The cost is determined using the following formula:threshold=K*max-loadcapacity=max(max-load−current-load, e)capacity=min(capacity, threshold)cost=link-cost*threshold/capacity

In this formula, e is a very small number (epsilon) and K is a tuningfactor initial set to 0.5. This formula causes the cost to a givenrepeater to be increased, at a rate defined by K, if its capacity fallsbelow a configurable threshold.

Given the cost of each candidate repeater, the BRS selects all repeaterswithin a delta factor of the best score. From this set, the result isselected at random.

The delta factor prevents the BRS from repeatedly selecting a singlerepeater when scores are similar. It is generally required becauseavailable information about load and link costs loses accuracy overtime. This factor is tunable.

Best Repeater Selector (BRS)

The BRS operates as follows, with reference to FIG. 6:

Given a client network address and the three tables described above:

-   -   E1. Determine which group the client is in using the Group        Reduction Table.    -   E2. For each repeater in the Link Cost Table and Load Table,        determine that repeater's combined cost as follows:        -   E2a. Determine the maximum and current load on the repeater            (using the Load Table).        -   E2b. Determine the link cost between the repeater and the            client's group (using the Link Cost Table).        -   E2c. Determine the combined cost as described above.    -   E3. Select a small set of repeaters with the lowest cost.    -   E4. Select a random member from the set.

Preferably the results of the BRS processing are maintained in a localcache at the reflector 108. Thus, if the best repeater has recently beendetermined for a given client (i.e., for a given network address), thatbest repeater can be reused quickly without being re-determined. Sincethe calculation described above is based on statically, pre-computedtables, if the tables have not changed then there is no need tore-determine the best repeater.

Determining the Group Reduction and Link Cost Tables

The Group Reduction Table and Link Cost Table used in BRS processing arecreated and regularly updated by an independent procedure referred toherein as NetMap. The NetMap procedure is run by executing severalphases (described below) as needed.

The term Group is used here to refers to an IP “address group”.

The term Repeater Group refers to a Group that contains the IP addressof a repeater.

The term link cost refers to a statically determined cost fortransmitting data between two Groups. In a presently preferredimplementation, this is the minimum of the sums of the costs of thelinks along each path between them. The link costs of primary concernhere are link costs between a Group and a Repeater Group.

The term relative link cost refers to the link cost relative to otherlink costs for the same Group which is calculated by subtracting theminimum link cost from a Group to any Repeater Group from each of itslink costs to a Repeater Group. The term Cost Set refers to a set ofGroups that are equivalent in regard to Best Repeater Selection. Thatis, given the information available, the same repeater would be selectedfor any of them.

The NetMap procedure first processes input files to create an internaldatabase called the Group Registry. These input files describe groups,the IP addresses within groups, and links between groups, and come avariety of sources, including publicly available Internet RoutingRegistry (IRR) databases, BGP router tables, and probe services that arelocated at various points around the Internet and use publicly availabletools (such as “traceroute”) to sample data paths. Once this processingis complete, the Group Registry contains essential information used forfurther processing, namely (1) the identity of each group, (2) the setof IP addresses in a given group, (3) the presence of links betweengroups indicating paths over which information may travel, and (4) thecost of sending data over a given link.

The following processes are then performed on the Group Registry file.

Calculate Repeater Group link costs

The NetMap procedure calculates a “link cost” for transmission of databetween each Repeater Group and each Group in the Group Registry. Thisoverall link cost is defined as the minimum cost of any path between thetwo groups, where the cost of a path is equal to the sum of the costs ofthe individual links in the path. The link cost algorithm presentedbelow is essentially the same as algorithm #562 from ACM journalTransactions on Mathematical Software: “Shortest Path From a SpecificNode to All Other Nodes in a Network” by U. Pape, ACM TOMS 6 (1980) pp.450-455, http://www.netlib.org/toms/562.

In this processing, the term Repeater Group refers to a Group thatcontains the IP address of a repeater. A group is a neighbor of anothergroup if the Group Registry indicates that there is a link between thetwo groups.

-   For each target Repeater Group T:-   Initialize the link cost between T and itself to zero.-   Initialize the link cost between T and every other Group to    infinity.-   Create a list L that will contain Groups that are equidistant from    the target Repeater Group T.-   Initialize the list L to contain just the target Repeater Group T    itself.-   While the list L is not empty:    -   Create an empty list L′ of neighbors of members of the list L.    -   For each Group G in the list L:        -   For each Group N that is a neighbor of G:            -   Let cost refer to the sum of the link cost between T and                G, and the link cost between G and N. The cost between T                and G was determined in the previous pass of the                algorithm; the link cost between G and N is from the                Group Registry.            -   If cost is less than the link cost between T and N:                -   Set the link cost between T and N to cost.                -   Add N to L′ if it is not already on it.    -   Set L to L′.

Calculate Cost Sets

A Cost Set is a set of Groups that are equivalent with respect to BestRepeater Selection. That is, given the information available, the samerepeater would be selected for any of them.

The “cost profile” of a Group G is defined herein as the set of costsbetween G and each Repeater. Two cost profiles are said to be equivalentif the values in one profile differ from the corresponding values in theother profile by a constant amount.

Once a client Group is known, the Best Repeater Selection algorithmrelies on the cost profile for information about the Group. If two costprofiles are equivalent, the BRS algorithm would select the samerepeater given either profile.

A Cost Set is then a set of groups that have equivalent cost profiles.

The effectiveness of this method can be seen, for example, in the casewhere all paths to a Repeater from some Group A pass through some otherGroup B. The two Groups have equivalent cost profiles (and are thereforein the same Cost Set) since whatever Repeater is best for Group A isalso going to be best for Group B, regardless of what path is takenbetween the two Groups.

By normalizing cost profiles, equivalent cost profiles can be madeidentical. A normalized cost profile is a cost profile in which theminimum cost has the value zero. A normalized cost profile is computedby finding the minimum cost in the profile, and subtracting that valuefrom each cost in the profile.

Cost Sets are then computed using the following algorithm:

-   For each Group G:    -   Calculate the normalized cost profile for G    -   Look for a Cost Set with the same normalized cost profile.    -   If such as set is found, add G to the existing Cost Set;    -   otherwise, create a new Cost Set with the calculated normalized        cost profile, containing only G.

The algorithm for finding Cost Sets employs a hash table to reduce thetime necessary to determine whether the desired Cost Set already exists.The hash table uses a hash value computed from cost profile of G.

Each Cost Set is then numbered with a unique Cost Sent Index number.Cost Sets are then used in a straightforward manner to generate the LinkCost Table, which gives the cost from each Cost Set to each Repeater.

As described below, the Group Reduction Table maps every IP address toone of these Cost Sets.

Build IP Map

The IP Map is a sorted list of records which map IP address ranges toLink Cost Table keys. The format of the IP map is:

-   -   <base IP address> <max IP address> <Link Cost Table key>        where IP addresses are presently represented by 32-bit integers.        The entries are sorted by descending base address, and by        ascending maximum address among equal base addresses, and by        ascending Link Cost Table key among equal base addresses and        maximum addresses. Note that ranges may overlap.

The NetMap procedure generates an intermediate IP map containing a mapbetween IP address ranges and Cost Set numbers as follows:

-   For each Cost Set S:    -   For each Group G in S:        -   For each IP address range in G:            -   Add a triple flow address, high address, Cost Set number                of S) to the IP map.

The IP map file is then sorted by descending base address, and byascending maximum address among equal base addresses, and by ascendingCost Set number among equal base addresses and maximum addresses. Thesort order for the base address and maximum address minimizes the timeto build the Group Reduction Table and produces the proper results foroverlapping entries.

Finally, the NetMap procedure creates the Group Reduction Table byprocessing the sorted IP map. The Group Reduction Table maps IPaddresses (specified by ranges) into Cost Set numbers. Specialprocessing of the IP map file is required in order to detect overlappingaddress ranges, and to merge adjacent address ranges in order tominimize the size of the Group Reduction Table.

An ordered list of address range segments is maintained, each segmentconsisting of a base address B and a Cost Set number N, sorted by baseaddress B. (The maximum address of a segment is the base address of thenext segment minus one.)

The following algorithm is used:

-   Initialize the list with the elements [−infinity, NOGROUP],    [+infinity, NOGROUP].    -   For each entry in the IP map, in sorted order, consisting of (b,        m, s),        -   Insert (b, m, s) in the list (recall that IP map entries are            of the form (low address, high address Cost Set number of            S))        -   For each reserved LAN address range (b, m):        -   Insert (b, m, LOCAL) in the list.    -   For each Repeater at address a:        -   Insert (a, a, REPEATER) in the list.    -   For each segment S in the ordered list:        -   Merge S with following segments with the same Cost Set        -   Create a Group Reduction Table entry with base address from            the base address of S,            -   max address=next segment's base−1,            -   group ID =Cost Set number of S.

A reserved LAN address range is an address range reserved for use byLANs which should not appear as a global Internet address. LOCAL is aspecial Cost Set index different from all others, indicating that therange maps to a client which should never be reflected. REPEATER is aspecial Cost Set index different from all others, indicating that theaddress range maps to a repeater. NOGROUP is a special Cost Set indexdifferent from all others, indicating that this range of addresses hasno known mapping.

-   -   Given (B, M, N), insert an entry in the ordered address list as        follows:    -   Find the last segment (AB, AN) for which AB is less than or        equal to B.    -   If AB is less than B, insert a new segment (B, N) after (AB,        AN).    -   Find the last segment (YB, YN) for which YB is less than or        equal to M.    -   Replace by (XB, N) any segment (XB, NOGROUP) for which XB is        greater than B and less than YB.    -   If YN is not N, and either YN is NOGROUP or YB is less than or        equal to B,        -   Let (ZB, ZN) be the segment following (YB, YN).        -   If M+1 is less than ZB, insert a new segment (M+1, YN)            before (ZB, ZN).        -   Replace (YB, YN) by (YB, N).

Rewriting HTML Resources

As explained above with reference to FIG. 3 (B5), when a reflector orrepeater serves a resource which itself includes resource identifiers(e.g., a HTML resource), that resource is modified (rewritten) topre-reflect resource identifiers (URLs) of repeatable resources thatappear in the resource. Rewriting ensures that when a browser requestsrepeatable resources identified by the requested resource, it gets themfrom a repeater without going back to the origin server, but when itrequests non-repeatable resources identified by the requested resource,it will go directly to the origin server. Without this optimization, thebrowser would either make all requests at the origin server (increasingtraffic at the origin server and necessitating far more redirectionsfrom the origin server), or it would make all requests at the repeater(causing the repeater to redundantly request and copy resources whichcould not be cached, increasing the overhead of serving such resources).

Rewriting requires that a repeater has been selected (as described abovewith reference to the Best Repeater Selector). Rewriting uses aso-called BASE directive. The BASE directive lets the HTML identify adifferent base server. (The base address is normally the address of theHTML resource.)

Rewriting is performed as follows:

-   -   F1. A BASE directive is added at the beginning of the HTML        resource, or modified where necessary. Normally, a browser        interprets relative URLs as being relative to the default base        address, namely, the URL of the HTML resource page) in which        they are encountered. The BASE address added specifies the        resource at the reflector which originally served the resource.        This means that unprocessed relative URLs (such as those        generated by Javascript™ programs) will be interpreted as        relative to the reflector. Without this BASE address, browsers        would combine relative addresses with repeater names to create        URLs which were not in the form required by repeaters (as        described above in step D1).    -   F2. The rewriter identifies directives, such as embedded images        and anchors, containing URLs. If the rewriter is running in a        reflector, it must parse the HTML file to identify these        directives.        -   If it is ruing in a repeater, the rewriter may have access            to pre-computed information that identifies the location of            each URL placed in the HTML file in step F4).    -   F3. For each URL encountered in the resource to be re-written,        the rewriter must determine whether the URL is repeatable (as in        steps B1-B2). If the URL is not repeatable, it is not modified.        On the other hand, if the URL is repeatable, it is modified to        refer to the selected repeater.    -   F4. After all URLs have been identified and modified, if the        resource is being served to a repeater, a table is appended at        the beginning of the resource that identifies the location and        content of each URL encountered in the resource. (This step is        an optimization which eliminates the need for parsing HTML        resources at the repeater.)    -   F5. Once all changes have been identified, a new length is        computed for the resource (page). The length is inserted in the        HTTP header prior to serving the resource.

An extension of HTML, known as XML, is currently being developed. Theprocess of rewriting URLs will be similar for XML, with some differencesin the mechanism that parses the resource and identifies embedded URLs.

Handling Non-HTTP Protocols

This invention makes it possible to reflect references to resources thatare served by protocols other than HTTP, for instance, the File TransferProtocol (FTP) and audio/video stream protocols. However, many protocolsdo not provide the ability to redirect requests. It is, however,possible to redirect references before requests are actually made byrewriting URLs embedded in HTML pages. The following modifications tothe above algorithms are used to support this capability.

In F4, the rewriter rewrites URLs for servers if those servers appear ina configurable table of cooperating origin server or so-calledco-servers. The reflector operator can define this table to include FTPservers and other servers. A rewritten URL that refers to a non-HTTPresource takes the form:

-   -   http://<repeater>/<origin        server>@proxy=<scheme>[:<type>]@/resource        where <scheme> is a supported protocol name such as “ftp”. This        URL format is an alternative to the form shown in B3.

In C3, the repeater looks for a protocol embedded in the arrivingrequest. If a protocol is present and the requested resource is notalready cached, the repeater uses the selected protocol instead of thedefault HTTP protocol to request the resource when serving it andstoring it in the cache.

System Configuration and Management

In addition to the processing described above, the repeater networkrequires various mechanisms for system configuration and networkmanagement. Some of these mechanisms are described here.

Reflectors allow their operators to synchronize repeater caches byperforming publishing operations. The process of keeping repeater cachessynchronized is described below. Publishing indicates that a resource orcollection of resources has changed.

Repeaters and reflectors participate in various types of log processing.The results of logs collected at repeaters are collected and merged withlogs collected at reflectors, as described below.

Adding Subscribers to the Repeater Network

When a new subscriber is added to the network, information about thesubscriber is entered in a Subscriber Table at the master repeater andpropagated to all repeaters in the network. This information includesthe Committed Aggregate Information Rate (CAIR) for servers belonging tothe subscriber, and a list of the repeaters that may be used by serversbelonging to the subscriber.

Adding Reflectors to the Repeater Network

When a new reflector is added to the network, it simply connects to andannounces itself to a contact repeater, preferably using a securelyencrypted certificate including the repeater's subscriber identifier.

The contact repeater determines whether the reflector network address ispermitted for this subscriber. If it is, the contact repeater acceptsthe connection and updates the reflector with all necessary tables(using version numbers to determine which tables are out of date).

The reflector processes requests during this time, but is not “enabled”(allowed to reflect requests) until all of its tables are current.

Keeping Repeater Caches Synchronized

Repeater caches are coherent, in the sense that when a change to aresource is identified by a reflector, all repeater caches are notified,and accept the change in a single transaction.

Only the identifier of the changed resource (and not the entireresource) is transmitted to the repeaters; the identifier is used toeffectively invalidate the corresponding cached resource at therepeater. This process is far more efficient than broadcasting thecontent of the changed resource to each repeater.

A repeater will load the newly modified resource the next time it isrequested.

A resource change is identified at the reflector either manually by theoperator, or through a script when files are installed on the server, orautomatically through a change detection mechanism (e.g., a separateprocess that checks regularly for changes).

A resource change causes the reflector to send an “invalidate” messageto its contact repeater, which forwards the message to the masterrepeater. The invalidate message contains a list of resource identifiers(or regular expressions identifying patterns of resource identifiers)that have changed. (Regular expressions are used to invalidate adirectory or an entire server.) The repeater network uses a two-phasecommit process to ensure that all repeaters correctly invalidate a givenresource.

The invalidation process operates as follows:

The master broadcasts a “phase 1” invalidation request to all repeatersindicating the resources and regular expressions describing sets ofresources to be invalidated.

When each repeater receives the phase 1 message, it first places theresource identifiers or regular expressions into a list of resourceidentifiers pending invalidation.

Any resource requested (in C3) that is in the pending invalidation listmay not be served from the cache. This prevents the cache fromrequesting the resource from a peer cache which may not have received aninvalidation notice. Were it to request a resource in this manner, itmight replace the newly invalidated resource by the same, now stale,data.

The repeater then compares the resource identifier of each resource inits cache against the resource identifiers and regular expressions inthe list.

Each match is invalidated by marking it stale and optionally removing itfrom the cache. This means that a future request for the resource willcause it to retrieve a new copy of the resource from the reflector.

When the repeater has completed the invalidation, it returns anacknowledgment to the master. The master waits until an repeaters haveacknowledged the invalidation request.

If a repeater fails to acknowledge within a given period, it isdisconnected from the master repeater. When it reconnects, it will betold to flush its entire cache, which will eliminate any consistencyproblem. (To avoid flushing the entire cache, the master could keep alog of all invalidations performed, sorted by date, and flush only filesinvalidated since the last time the reconnecting repeater successfullycompleted an invalidation. In the presently preferred embodiments thisis not done since it is believed that repeaters will seldom disconnect.)

When all repeaters have acknowledged invalidation (or timed out) therepeater broadcasts a “phase 2” invalidation request to all repeaters.This causes the repeaters to remove the corresponding resourceidentifiers and regular expressions from the list of resourceidentifiers pending invalidation.

In another embodiment, the invalidation request will be extended toallow a “server push”. In such requests, after phase 2 of theinvalidation process has completed, the repeater receiving theinvalidation request will immediately request a new copy of theinvalidated resource to place in its cache.

Logs and Log Processing

Web server activity logs are fundamental to monitoring the activity in aWeb site. This invention creates “merged logs” that combine the activityat reflectors with the activity at repeaters, so that a single activitylog appears at the origin server showing all Web resource requests madeon behalf of that site at any repeater.

This merged log can be processed by standard processing tools, as if ithad been generated locally.

On a periodic basis, the master repeater (or its delegate) collects logsfrom each repeater. The logs collected are merged, sorted by reflectoridentifier and timestamp, and stored in a dated file on a per-reflectorbasis. The merged log for a given reflector represents the activity ofall repeaters on behalf of that reflector. On a periodic basis, asconfigured by the reflector operator, a reflector contacts the masterrepeater to request its merged logs. It downloads these and merges themwith its locally maintained logs, sorting by timestamp. The result is amerged log that represents all activity on behalf of repeaters and thegiven reflector.

Activity logs are optionally extended with information important to therepeater network, if the reflector is configured to do so by thereflector operator. In particular, an “extended status code” indicatesinformation about each request, such as:

1. request was served by a reflector locally;

2. request was reflected to a repeater;*

3. request was served by a reflector to a repeater;*

4. request for non-repeatable resource was served by repeater;*

5. request was served by a repeater from the cache;

6. request was served by a repeater after filling cache;

7. request pending invalidation was served by a repeater.

(The activities marked with “*” represent intermediate states of arequest and do not normally appear in a final activity log.)

In addition, activity logs contain a duration, and extended precisiontimestamps. The duration makes it possible to analyze the time requiredto serve a resource, the bandwidth used, the number of requests handledin parallel at a given time, and other quite useful information. Theextended precision timestamp makes it possible to accurately mergeactivity logs.

Repeaters use the Network Time Protocol (NTP) to maintain synchronizedclocks. Reflectors may either use NTP or calculate a time bias toprovide roughly accurate timestamps relative to their contact repeater.

Enforcing Committed Aggregate Information Rate

The repeater network monitors and limits the aggregate rate at whichdata is served on behalf of a given subscriber by all repeaters. Thismechanism provides the following benefits:

-   -   1. provides a means of pricing repeater service;    -   2. provides a means for estimating and reserving capacity at        repeaters;    -   3. provides a means for preventing clients of a busy site from        limiting access to other sites.

For each subscriber, a “threshold aggregate information rate” (TAIR) isconfigured and maintained at the master repeater. This threshold is notnecessarily the committed rate, it may be a multiple of committed rate,based on a pricing policy.

Each repeater measures the information rate component of each reflectorfor which it serves resources, periodically (typically about once aminute), by recording the number of bytes transmitted on behalf of thatreflector each time a request is delivered. The table thus created issent to the master repeater once per period. The master repeatercombines the tables from each repeater, summing the measured informationof each reflector over all repeaters that serve resources for thatreflector, to determine the “measured aggregate information rate” (MAIR)for each reflector.

If the MAIR for a given reflector is greater than the TAIR for thatreflector, the MAIR is transmitted by the master to all repeaters and tothe respective reflector.

When a reflector receives a request, it determines whether its mostrecently calculated MAIR is greater than its TAIR. If this is the case,the reflector probabilistically decides whether to suppress reflection,by serving the request locally (in B2). The probability of suppressingthe reflection increases as an exponential function of the differencebetween the MAIR and the CAIR.

Serving a request locally during a peak period may strain the localorigin server, but it prevents this subscriber from taking more thanallocated bandwidth from the shared repeater network.

When a repeater receives a request for a given subscriber (in C2), itdetermines whether the subscriber is running near its thresholdaggregate information rate. If this is the case, it probabilisticallydecides whether to reduce its load by redirecting the request back tothe reflector. The probability increases exponentially as thereflector's aggregate information rate approaches its limit.

If a request is reflected back to a reflector, a special characterstring is attached to the resource identifier so that the receivingreflector will not attempt to reflect it again. In the current system,this string has the form

“src=overload”.

The reflector tests for this string in B2.

The mechanism for limiting Aggregate Information Rate described above isfairly coarse. It limits at the level of sessions with clients (sinceonce a client has been reflected to a given repeater, the rewritingprocess tends to keep the client coming back to that repeater) and, atbest, individual requests for resources. A more fine-grained mechanismfor enforcing TAIR limits within repeaters operates by reducing thebandwidth consumption of a busy subscriber when other subscribers arecompeting for bandwidth.

The fine-grained mechanism is a form of data “rate shaping”. It extendsthe mechanism that copies resource data to a connection when a reply isbeing sent to a client. When an output channel is established at thetime a request is received, the repeater identifies which subscriber thechannel is operating for, in C2, and records the subscriber in a datafield associated with the channel. Each time a “write” operation isabout to be made to the channel, the Metered Output Stream firstinspects the current values of the MAIR and TAIR, calculated above, forthe given subscriber. If the MAIR is larger than the TAIR, then themechanism pauses briefly before performing the write operation. Thelength of the pause is proportional to the amount the MAIR exceeds theTAIR. The pause ensures that tasks sending other resources to otherclients, perhaps on behalf of other subscribers, will have anopportunity to send their data.

Repeater Network Resilience

The repeater network is capable of recovering when a repeater or networkconnection fails.

A repeater cannot operate unless it is connected to the master repeater.The master repeater exchanges critical information with other repeaters,including information about repeater load, aggregate information rate,subscribers, and link cost.

If a master fails, a “succession” process ensures that another repeaterwill take over the role of master, and the network as a whole willremain operational. If a master fails, or a connection to a master failsthrough a network problem, any repeater attempting to communicate withthe master will detect the failure, either through an indication fromTCP/IP, or by timing out from a regular “heartbeat” message it sends tothe master.

When any repeater is disconnected from its master, it immediately triesto reconnect to a series of potential masters based on a configurablefile called its “succession list”.

The repeater tries each system on the list in succession until itsuccessfully connects to a master. If in this process, it comes to itsown name, it takes on the role of master, and accepts connections fromother repeaters. If a repeater which is not at the top of the listbecomes the master, it is called the “temporary master”.

A network partition may cause two groups of repeaters each to elect amaster. When the partition is corrected, it is necessary that the moresenior master take over the network. Therefore, when a repeater istemporary master, it regularly tries to reconnect to any master above itin the succession list. If it succeeds, it immediately disconnects fromall of the repeaters connected to it. When they retry their successionlists, they will connect to the more senior master repeater.

To prevent losses of data, a temporary master does not acceptconfiguration changes and does not process log files. In order to takeon these tasks, it must be informed that it is primary master by manualmodification of its successor list. Each repeater regularly reloads itssuccessor list to determine whether it should change its idea of who themaster is.

If a repeater is disconnected from the master, it must resynchronize itscache when it reconnects to the master. The master can maintain a listof recent cache invalidations and send to the repeater any invalidationsit was not able to process while disconnected. If this list is notavailable for some reason (for instance, because the reflector has beendisconnected too long), the reflector must invalidate its entire cache.

A reflector is not permitted to reflect requests unless it is connectedto a repeater. The reflector relies on its contact repeater for criticalinformation, such as load and Link Cost Tables, and current aggregateinformation rate. A reflector that is not connected to a repeater cancontinue to receive requests and handle them locally.

If a reflector loses its connection with a repeater, due to a repeaterfailure or network outage, it continues to operate while it tries toconnect to a repeater.

Each time a reflector attempts to connect to a repeater, it uses DNS toidentify a set of candidate repeaters given a domain name thatrepresents the repeater network. The reflector tries each repeater inthis set until it makes a successful contact. Until a successful contactis made, the reflector serves all requests locally. When a reflectorconnects to a repeater, the repeater can tell it to attempt to contact adifferent repeater; this allows the repeater network to ensure that noindividual repeater has too many contacts.

When contact is made, the reflector provides the version number of eachof its tables to its contact repeater. The repeater then decides whichtables should be updated and sends appropriate updates to the reflector.Once all tables have been updated, the repeater notifies the reflectorthat it may now start reflecting requests.

Using a Proxy Cache within a Repeater

Repeaters are intentionally designed so that any proxy cache can be usedas a component within them. This is possible because the repeaterreceives HTTP requests and converts them to a form recognized by theproxy cache.

On the other hand, several modifications to a standard proxy cache havebeen or may be made as optimizations. This includes, in particular, theability to conveniently invalidate a resource, the ability to supportcache quotas, and the ability to avoid making an extra copy of eachresource as it passes from the proxy cache through the repeater to therequester.

In a preferred embodiment, a proxy cache is used to implement C3. Theproxy cache is dedicated for use only by one or more repeaters. Eachrepeater requiting a resource from the proxy cache constructs a proxyrequest from the inbound resource request. A normal HTTP GET request toa server contains only the pathname part of the URL—the scheme andserver name are implicit. (n an HTTP GET request to a repeater, thepathname part of the URL includes the name of the origin server onbehalf of which the request is being made, as described above.) However,a proxy agent GET request takes an entire URL. Therefore, the repeatermust construct a proxy request containing the entire URL from the pathportion of the URL it receives. Specifically, if the incoming requesttakes the form:

-   -   GET/<origin server>/<path>        then the repeater constructs a proxy request of the form:    -   GET http://<origin server>/<path>        and if the incoming request takes the form:    -   GET <origin server>@proxy=<scheme>:<type>@/<path>        then the repeater constructs a proxy request of the form:    -   GET <scheme>://<origin server>/<path>

Cache Control

HTTP replies contain directives called cache control directives, whichare used to indicate to a cache whether the attached resource may becached and if so, when it should expire. A Web site administratorconfigures the Web site to attach appropriate directives. Often, theadministrator will not know how long a page will be fresh, and mustdefine a short expiration time to try to prevent caches from servingstale data. In many cases, a Web site operator will indicate a shortexpiration time only in order to receive the requests (or hits) thatwould otherwise be masked by the presence of a cache. This is known inthe industry as “cache-busting”. Although some cache operators mayconsider cache-busting to be impolite, advertisers who rely on thisinformation may consider it imperative.

When a resource is stored in a repeater, its cache directives can beignored by the repeater, because the repeater receives explicitinvalidation events to determine when a resource is stale. When a proxycache is used as the cache at the repeater, the associated cachedirectives may be temporarily disabled. However, they must be re-enabledwhen the resource is served from the cache to a client, in order topermit the cache-control policy (including any cache-busting) to takeeffect.

The present invention contains mechanisms to prevent the proxy cachewithin a repeater from honoring cache control directives, whilepermitting the directives to be served from the repeater.

When a reflector serves a resource to a repeater in B4, it replaces allcache directives by modified directives that are ignored by the repeaterproxy cache. It does this by prefixing a distinctive string such as“wr-” to the beginning of the HTTP tag. Thus, “expires” becomes“wr-expires”, and “cache-control” becomes “wr-cache-control”. Thisprevents the proxy cache itself from honoring the directives. When arepeater serves a resource in C4, and the requesting client is notanother repeater, it searches for HTTP tags beginning with “wr-” andremoves the “wr-”. This allows the clients retrieving the resource tohonor the directives.

Resource Revalidation

There are several cases where a resource may be cached so long as theorigin server is consulted each time it is served. In one case, therequest for the resource is attached to a so-called “cookie”. The originserver must be presented with the cookie to record the request anddetermine whether the cached resource may be served or not. In anothercase, the request for the resource is attached to an authenticationheader (which identifies the requester with a user id and password).Each new request for the resource must be tested at the origin server toassure that the requester is authorized to access the resource.

The HTTP 1.1 specification defines a reply header titled“Must-Revalidate” which allows an origin server to instruct a proxycache to “revalidate” a resource each time a request is received.Normally, this mechanism is used to determine whether a resource isstill fresh. In the present invention, Must-Revalidate makes it possibleto ask an origin server to validate a request that is otherwise servedfrom a repeater.

The reflector rule base contains information that determines whichresources may be repeated but must be revalidated each time they areserved. For each such resource, in B4, the reflector attaches aMust-Revalidate header. Each time a request comes to a repeater for acached resource marked with a Must-Revalidate header, the request isforwarded to the reflector for validation prior to serving the requestedresource.

Cache Quotas

The cache component of a repeater is shared among those subscribers thatreflect clients to that repeater. In order to allow subscribers fairaccess to storage facilities, the cache may be extended to supportquotas.

Normally, a proxy cache may be configured with a disk space threshold T.Whenever more than T bytes are stored in the cache, the cache attemptsto find resources to eliminate.

Typically a cache uses the least-recently-used (LRU) algorithm todetermine which resources to eliminate; more sophisticated caches useother algorithms. A cache may also support several threshold values—forinstance, a lower threshold which, when reached, causes a low prioritybackground process to remove items from the cache, and a higherthreshold which, when reached, prevents resources from being cacheduntil sufficient free disk space has been reclaimed.

If two subscribers A and B share a cache, and more resources ofsubscriber A are accessed during a period of time than resources ofsubscriber B, then fewer of B's resources will be in the cache when newrequests arrive. It is possible that, due to the behavior of A, B'sresources will never be cached when they are requested. In the presentinvention, this behavior is undesirable. To address this issue, theinvention extends the cache at a repeater to support cache quotas.

The cache records the amount of space used by each subscriber in D_(S),and supports a configurable threshold T_(S) for each subscriber.

Whenever a resource is added to the cache (at C3), the value D_(S) isupdated for the subscriber providing the resource. If D_(S) is largerthan T_(S), the cache attempts to find resources to eliminate, fromamong those resources associated with subscriber S. The cache iseffectively partitioned into separate areas for each subscriber.

The original threshold T is still supported. If the sum of reservedsegments for each subscriber is smaller than the total space reserved inthe cache, the remaining area is “common” and subject to competitionamong subscribers.

Note, this mechanism might be implemented by modifying the existingproxy cache discussed above, or it might also be implemented withoutmodifying the proxy cache—if the proxy cache at least makes it possiblefor an external program to obtain a list of resources in the cache, andto remove a given resource from the cache.

Rewriting from Repeaters

When a repeater receives a request for a resource, its proxy cache maybe configured to determine whether a peer cache contains the requestedresource. If so, the proxy cache obtains the resource from the peercache, which can be faster than obtaining it from the origin server (thereflector). However, a consequence of this is that rewritten HTMLresources retrieved from the peer cache would identify the wrongrepeater. Thus, to allow for cooperating proxy caches, resources arepreferably rewritten at the repeater.

When a resource is rewritten for a repeater, a special tag is placed atthe beginning of the resource. When constructing a reply, the repeaterinspects the tag to determine whether the resource indicates thatadditional rewriting is necessary. If so, the repeater modifies theresource by replacing references to the old repeater with references tothe new repeater.

It is only necessary to perform this rewriting when a resource is servedto the proxy cache at another repeater.

Repeater-Side Include

Sometimes, an origin server constructs a custom resource for eachrequest (for instance, when inserting an advertisement based on thehistory of the requesting client). In such a case, that resource must beserved locally rather than repeated. Generally, a custom resourcecontains, along with the custom information, text and references toother, repeatable, resources.

The process that assembles a “page” from a text resource and possiblyone or more image resources is performed by the Web browser, directed byHTML. However, it is not possible using HTML to cause a browser toassemble a page using text or directives from a separate resource.Therefore, custom resources often necessarily contain large amounts ofstatic text that would otherwise be repeatable.

To resolve this potential inefficiency, repeaters recognize a specialdirective called a “repeater side include”. This directive makes itpossible for the repeater to assemble a custom resource, using acombination of repeatable and local resources. In this way, the statictext can be made repeatable, and only the special directive need beserved locally by the reflector.

For example, a resource X might consist of custom directives selectingan advertising banner, followed by a large text article. To make thisresource repeatable, the Web site administrator must break out a secondresource, Y, to select the banner. Resource X is modified to contain arepeater-side include directive identifying resource Y, along with thearticle. Resource Y is created and contains only the custom directivesselecting an ad banner. Now resource X is repeatable, and only resourceY, which is relatively small, is not repeatable.

When a repeater constructs a reply, it determines whether the resourcebeing served is an HTML resource, and if so, scans it for repeater-sideinclude directives. Each such directive includes a URL, which therepeater resolves and substitutes in place of the directive. The entireresource must be assembled before it is served, in order to determineits final size, as the size is included in a reply header ahead of theresource.

Thus, a method and apparatus for dynamically replicating selectedresources in computer networks is provided. One skilled in the art willappreciate that the present invention can be practiced by other than thedescribed embodiments, which are presented for purposes of illustrationand not limitation, and the present invention is limited only by theclaims that follow.

1. A method of processing requests for resources in a system in which aplurality of content providers provide multiple resources, the methodcomprising: responsive to a first request from a first client for afirst resource, said first resource being associated with a firstcontent provider, said first request including at least a firsthostname, causing said first resource to be served to the first clientfrom a shared content delivery network (CDN) formed by a plurality ofrepeater servers; and responsive to a second request from a secondclient for a second resource, said second resource being associated witha second content provider distinct from said first content provider, andsaid second request including at least a second hostname distinct fromsaid first hostname, causing said second resource to be served to thesecond client from the shared CDN.
 2. A method as in claim 1 wherein thefirst resource is a first embedded object referenced in a first web pageassociated with the first content provider, said first web page havingbeen served to the first client from a first origin server associatedwith the first content provider.
 3. A method as in claim 2 wherein thesecond resource is a second embedded object referenced in a second webpage associated with the second content provider, said second web pagehaving been served to the second client from a second origin serverassociated with the second content provider.
 4. A method as in claim 1wherein said first resource is served to the first client from theshared CDN instead of from a first origin server associated with thefirst content provider; and said second resource is served to the secondclient from the shared CDN instead of from a second origin serverassociated with the second content provider, said second origin serverbeing distinct from said first origin server.
 5. A method as in claim 1further comprising: providing said shared CDN.
 6. A method as in claim 1wherein the first content provider is associated with a first domain andthe second content provider is associated with a second domain, distinctfrom the first domain.
 7. A method as in claim 6 wherein the firsthostname resolves to the shared CDN and wherein the second hostnameresolves to the shared CDN.
 8. A method as in claim 1 wherein the firstresource is to be served from a first CDN server, the method furthercomprising: when the first CDN server does not have the first resource,said first CDN server obtaining a copy of the first resource.
 9. Amethod as in claim 8 further comprising: said first CDN server servingthe first resource to the first client.
 10. A method as in claim 8wherein the first CDN server obtains a copy of the first resource from apeer server.
 11. A method as in claim 8 wherein the first CDN serverobtains a copy of the first resource from a first origin serverassociated with the first content provider.
 12. A method as in claim 1wherein the first resource is to be served to the first client from afirst CDN server and wherein the second resource is to be served to thesecond client from a second CDN server, the method further comprising:when the first CDN server does not have the first resource, said firstCDN server obtaining the first resource; and said first CDN serverserving the first resource to the first client; and when the second CDNserver does not have the second resource, said second CDN serverobtaining the second resource; and said second CDN server serving thesecond resource to said second client.
 13. A method as in claim 12wherein: the first CDN server obtains the first resource from a peerserver or from a first origin server associated with the first contentprovider; and the second CDN server obtains the second resource from apeer server or from a second origin server associated with the secondcontent provider.
 14. A method as in any one of claims 1-13 wherein thesystem comprises the Internet, and wherein the first request is based,at least in part, on a first Uniform Resource Locator (URL) thatincludes said first hostname, and wherein the second request is based,at least in part, on a second URL that includes said second hostname.15. A method as in claim 14 wherein the first resource is a resourceselected from the group comprising static and dynamic: video content,audio content, text, image content, web pages, HTML files, XML files,files in a markup language, documents, hypertext documents, data files,and embedded resources; and the second resource is a resource selectedfrom the group comprising static and dynamic: video content, audiocontent, text, image content, web pages, HTML files, XML files, files ina markup language, documents, hypertext documents, data files, andembedded resources.
 16. A method of processing resource requests in acomputer network, the method comprising: (A) providing a shared networkof repeater servers; (B) responsive to a first request for a firstresource, said first resource being associated with a first contentprovider, at a first repeater server in the shared network of repeaterservers, (b1) if said first repeater server does not have said firstresource, said first repeater server obtaining a copy of said firstresource; and (b2) said first repeater serving said first resource; and(C) responsive to a second request, the second request being for asecond resource distinct from said first resource, and said secondresource being associated with a second content provider distinct fromsaid first content provider, at a second repeater server in the sharednetwork of repeater servers, (c1) if said second repeater server doesnot have said second resource, said second repeater server obtaining acopy of said second resource; and (c2) said second repeater serving saidsecond resource.
 17. A method as in claim 16 wherein the first resourceis served from said first repeater server instead of from a first originserver associated with the first content provider, and wherein thesecond resource is served from said second repeater server instead offrom a second origin server associated with the second content provider.18. A method as in claim 17 wherein said first origin server and saidsecond origin server are distinct from said repeater servers.
 19. Amethod as in claim 16 wherein said first repeater server attempts toobtain a copy of said first resource from a peer server or from a firstorigin server associated with said first content provider, and saidsecond repeater server attempts to obtain a copy of said second resourcefrom a peer server or from a second origin server associated with saidsecond content provider.
 20. A method as in any one of claims 16-19wherein the system comprises the Internet, and wherein the first requestis based at least in part on a first Uniform Resource Locator (URL) thatincludes said first hostname, and wherein the second request is based,at least in part, on a second URL that includes said second hostname.21. A method as in claim 20 wherein the first resource is a resourceselected from the group comprising static and dynamic: video content,audio content, text, image content, web pages, HTML files, XML files,files in a markup language, documents, hypertext documents, data files,and embedded resources; and the second resource is a resource selectedfrom the group comprising static and dynamic: video content, audiocontent, text, image content, web pages, HTML files, XML files, files ina markup language, documents, hypertext documents, data files, andembedded resources.
 22. A method as in claim 16 wherein: said firstrequest is an HTTP request.
 23. A method as in claim 22 wherein saidHTTP request includes a first hostname that resolves to said sharednetwork of repeater servers.
 24. A method as in claim 23 wherein saidHTTP request is directed to said first repeater server by an HTTPREDIRECT command.
 25. A method of processing requests for resources inthe Internet, wherein multiple content providers provide multipleresources to multiple clients, the method comprising: providing a sharedcontent delivery network (CDN), said CDN being formed by a plurality ofrepeater servers, wherein at least some of said repeater servers areconstructed and adapted to respond to client requests for resources froma plurality of content providers, and wherein a first resource,requested by a first client, said first resource being associated with afirst content provider, is served to said first client from said sharedCDN instead of from said first content provider; and wherein a secondresource, requested by a second client, said second resource beingassociated with a second content provider distinct from said firstcontent provider, is served from said shared CDN instead of from saidsecond content provider.